package com.wardrobe.smartWardrobe.service;

import com.wardrobe.smartWardrobe.common.R;
import com.wardrobe.smartWardrobe.entity.Media;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.File;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author tky
 * @since 2024-03-24
 */
public interface MediaService extends IService<Media> {
    public Media saveToDb(String fileMd5,Media media, String bucket, String objectName,String mimeType );
    public Media uploadFile(Media media, String localFilePath,String objectName);
    public R<Boolean> checkChunk(String fileMd5, int chunkIndex);
    public R<Boolean> uploadChunk(String fileMd5, int chunk, String localChunkFilePath);
    public R<Boolean> mergechunks(String fileMd5, int chunkTotal, Media media);
    public R<Boolean> checkFile(String fileMd5);
    public File downloadFileFromMinIO(String bucket, String objectName);
    public String getFilePathByMd5(String fileMd5,String extension);
    public boolean savaToMinio(String bucket,String localFilePath, String objectName,String mimeType);
}
